package com.ymttest.database.sqlwapper.shenqisettlement;

import java.util.HashMap;
import java.util.List;

import com.ymt.core.tool.Logger;
import com.ymt.database.SqlManager;
import com.ymttest.database.model.shenqisettlement.ProviderSettlementDetail;

public class ProviderSettlementDetailWrapper {

	SqlManager manager;

    public ProviderSettlementDetailWrapper() {
        manager = new SqlManager("shenqisettlement");
    }
    
    @SuppressWarnings("unchecked")
	public ProviderSettlementDetail selectByOrderIdAndProviderId(long orderId, Long providerId) {
    	
    	HashMap<String, Long> map = new HashMap<>();
    	
    	map.put("order_id", orderId);
    	map.put("provider_id", providerId);
    	
		List<ProviderSettlementDetail> result = manager
				.getSelectResults(
						"com.ymttest.database.mapping.shenqisettlement.ProviderSettlementDetailMapper.selectByOrderIdAndProviderId",
						map);
		manager.commit();
        
		if (result.size() == 0) {
			Logger.comment("provider_settlement_detail没有数据");
			
			return null;
		}
		
		return result.get(0);
    }
    
    public static void main(String[] args) {
    	
    	ProviderSettlementDetailWrapper test = new ProviderSettlementDetailWrapper();

    	System.out.println(test.selectByOrderIdAndProviderId(8219298699L, 500320077L).getIncome_currency());
    }
}
